#ifndef tk_datetime_h__
#define tk_datetime_h__

#include <QDateTime>

#ifdef Q_OS_WIN
#	include <windows.h>
#	include <mmsystem.h>
#	pragma comment(lib,"winmm.lib")
#endif // #ifdef Q_OS_WIN


inline static tk_int64 GetTimeStampMs()
{
	return QDateTime::currentMSecsSinceEpoch();
}


/*
//======================================================================
#include <boost/date_time/posix_time/posix_time.hpp>
#include <boost/date_time/gregorian/gregorian.hpp>

typedef boost::posix_time::ptime			tk_ptime;
typedef boost::posix_time::time_duration	tk_ptime_duration;

typedef boost::gregorian::date				tk_date;
typedef boost::gregorian::date::ymd_type	tk_ymd;
typedef boost::gregorian::date_duration		tk_data_duration;

#define TK_PTIME_LOCAL		(boost::posix_time::microsec_clock::local_time())
#define TK_PTIME_UTC		(boost::posix_time::microsec_clock::universal_time())
#define TK_PTIME_NULL		(boost::date_time::not_a_date_time)

//=======================================================================
#include <boost/chrono.hpp>
//================clock===========================

//get the clock time since 1 January 1970
typedef boost::chrono::system_clock tk_time_clock;

#ifdef BOOST_CHRONO_HAS_CLOCK_STEADY
typedef boost::chrono::steady_clock tk_system_clock;
#endif
//is a type definition for 
//boost::chrono::system_clock or boost::chrono::steady_clock, 
//depending on which clock measures time more precisely.
//
typedef boost::chrono::high_resolution_clock tk_high_resolution_clock;

#ifdef BOOST_CHRONO_HAS_PROCESS_CLOCKS
//measures the time since program start
typedef boost::chrono::process_real_cpu_clock tk_process_real_clock;
//only the time spent running in user space
typedef boost::chrono::process_user_cpu_clock tk_process_user_clock;
//measures the time spent in kernel space
typedef boost::chrono::process_system_cpu_clock tk_process_sys_clock;
//all of above three clocks
typedef boost::chrono::process_cpu_clock tk_process_clock;
#endif

#ifdef BOOST_CHRONO_HAS_THREAD_CLOCK
typedef boost::chrono::thread_clock tk_thread_clock;
#endif

*================time point===========================

#define TK_CLOCK_TIME_POINT(clock) clock::time_point
#define TK_CLOCK_TIME_POINT_NOW(clock) clock::now()

/================time duration===========================
typedef boost::chrono::nanoseconds	tk_clock_dur_nanosec;
typedef boost::chrono::milliseconds tk_clock_dur_millisec;
typedef boost::chrono::microseconds tk_clock_dur_microsec;
typedef boost::chrono::seconds		tk_clock_dur_sec;
typedef boost::chrono::minutes		tk_clock_dur_minutes;
typedef boost::chrono::hours		tk_clock_dur_hours;
*/


#endif // tk_datetime_h__
